package org.apache.jsp;

import javax.servlet.*;
import javax.servlet.http.*;
import javax.servlet.jsp.*;

public final class search_jsp extends org.apache.jasper.runtime.HttpJspBase
    implements org.apache.jasper.runtime.JspSourceDependent {

  private static final javax.servlet.jsp.JspFactory _jspxFactory =
          javax.servlet.jsp.JspFactory.getDefaultFactory();

  private static java.util.List<java.lang.String> _jspx_dependants;

  private javax.el.ExpressionFactory _el_expressionfactory;
  private org.apache.tomcat.InstanceManager _jsp_instancemanager;

  public java.util.List<java.lang.String> getDependants() {
    return _jspx_dependants;
  }

  public void _jspInit() {
    _el_expressionfactory = _jspxFactory.getJspApplicationContext(getServletConfig().getServletContext()).getExpressionFactory();
    _jsp_instancemanager = org.apache.jasper.runtime.InstanceManagerFactory.getInstanceManager(getServletConfig());
  }

  public void _jspDestroy() {
  }

  public void _jspService(final javax.servlet.http.HttpServletRequest request, final javax.servlet.http.HttpServletResponse response)
        throws java.io.IOException, javax.servlet.ServletException {

    final javax.servlet.jsp.PageContext pageContext;
    javax.servlet.http.HttpSession session = null;
    final javax.servlet.ServletContext application;
    final javax.servlet.ServletConfig config;
    javax.servlet.jsp.JspWriter out = null;
    final java.lang.Object page = this;
    javax.servlet.jsp.JspWriter _jspx_out = null;
    javax.servlet.jsp.PageContext _jspx_page_context = null;


    try {
      response.setContentType("text/html");
      pageContext = _jspxFactory.getPageContext(this, request, response,
      			null, true, 8192, true);
      _jspx_page_context = pageContext;
      application = pageContext.getServletContext();
      config = pageContext.getServletConfig();
      session = pageContext.getSession();
      out = pageContext.getOut();
      _jspx_out = out;

      out.write("<html>\r\n");
      out.write("<head>\r\n");
      out.write("<title>Mr.Typ</title>\r\n");
      out.write("<link type=\"text/css\" rel=\"stylesheet\" href=\"stuff/result.css\" />\r\n");
      out.write("<script type=\"text/javascript\" src=\"stuff/search.js\"></script>\r\n");
      out.write("\r\n");
      mrtyp.SearchBean jb = null;
      synchronized (application) {
        jb = (mrtyp.SearchBean) _jspx_page_context.getAttribute("jb", javax.servlet.jsp.PageContext.APPLICATION_SCOPE);
        if (jb == null){
          jb = new mrtyp.SearchBean();
          _jspx_page_context.setAttribute("jb", jb, javax.servlet.jsp.PageContext.APPLICATION_SCOPE);
        }
      }
      out.write('\r');
      out.write('\n');

String query = request.getParameter("query");
String time = request.getParameter("time");
String lon = request.getParameter("lon");
String lat = request.getParameter("lat");
String radius = request.getParameter("radius");

      out.write("\r\n");
      out.write("</head>\r\n");
      out.write("\r\n");
      out.write("<body>\r\n");
      out.write("\r\n");
      out.write("<table>\r\n");
      out.write("<tr>\r\n");
      out.write("<td width=\"100px\">\r\n");
      out.write("<img src=\"stuff/mrtyp.png\" width=\"100px\"/>\r\n");
      out.write("</td>\r\n");
      out.write("\r\n");
      out.write("<td width=\"700%\">\r\n");
      out.write("<form action=\"search.jsp\" method=\"get\">\r\n");
      out.write("<input type=\"text\" id=\"searchbox\" name=\"query\">\r\n");
      out.write("<input type=\"hidden\" name=\"time\" value=\"");
      out.print(time);
      out.write("\" />\r\n");
      out.write("<input type=\"hidden\" name=\"lon\" value=\"");
      out.print(lon);
      out.write("\" />\r\n");
      out.write("<input type=\"hidden\" name=\"lat\" value=\"");
      out.print(lat);
      out.write("\" />\r\n");
      out.write("<input type=\"hidden\" name=\"radius\" value=\"");
      out.print(radius);
      out.write("\" />\r\n");
      out.write("<input type =\"submit\" id=\"button\" value=\"search\">\r\n");
      out.write("</form>\r\n");
      out.write("</td>\r\n");
      out.write("\r\n");
      out.write("</tr>\r\n");
      out.write("</table>\r\n");
      out.write("\r\n");
      out.print( jb.search(query,time,lon,lat,radius) );
      out.write("\r\n");
      out.write("</body>\r\n");
      out.write("\r\n");
      out.write("</html>\r\n");
    } catch (java.lang.Throwable t) {
      if (!(t instanceof javax.servlet.jsp.SkipPageException)){
        out = _jspx_out;
        if (out != null && out.getBufferSize() != 0)
          try { out.clearBuffer(); } catch (java.io.IOException e) {}
        if (_jspx_page_context != null) _jspx_page_context.handlePageException(t);
      }
    } finally {
      _jspxFactory.releasePageContext(_jspx_page_context);
    }
  }
}
